$ () ->
	$(".create_btn").click (e) ->
		param=
			name:$("#name").val()
			uname:$("#uname").val()
			role_id:$("#role_id").val()
			password:$("#password").val()

		$.post "/api/user/create", param, (res) ->
			if res.status.errCode is 0
				alert "创建成功"
				window.location.href = "/user/list"
			else
				alert res.status.message


	$(".cancel_btn").click (e) ->
		history.go(-1)
		location.reload()